//
//  DistributionWayViewController.m
//  WeiWeiHaircut
//
//  Created by apple on 15/12/17.
//  Copyright © 2015年 超群. All rights reserved.
//

#import "DistributionWayViewController.h"

@interface DistributionWayViewController ()

@end

@implementation DistributionWayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createTableViewWithPlainStyle:YES andSeparatorStyleNone:NO andBackGroudImageName:nil];
    [self addBtnOnNavWithTitle:@"确认订单" andImageName:@"返回" andTarget:self andAction:@selector(backAction) andFrame:CGRectMake(0, 0, 80, 20) andDirection:left];
    [self downloadDatas];
}
- (void)backAction{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)downloadDatas{
    
    [self.tableSource addObject:@[@"快递包邮",@"自付邮费"]];
    [self.tableView reloadData];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    NSString *cellID = @"cellID";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        cell.textLabel.textColor = purColor2;
        [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
    }
    cell.textLabel.text = self.tableSource[indexPath.section][indexPath.row];
    
    return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 40;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return self.tableSource.count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return [self.tableSource[section] count];
}
- (void)actionAtIndexPath:(NSIndexPath *)indexPath{
    
    if (_SelectPreferentail) {
        _SelectPreferentail(self.tableSource[indexPath.section][indexPath.row]);
        [self.navigationController popViewControllerAnimated:YES];
    }
    
}


@end
